const fnDebugLog = require('debug')('decorator')

// export function Controller(target:any) {
//   fnDebugLog(target)
// }

export const Controller = (rootPath: string) => (target:any) => {
  fnDebugLog(target)
  target.prototype.root = rootPath;
}

export const Get = (route?:string) => (target: any, propertyKey: string, descriptor: PropertyDescriptor) => {
  if (!target.handlersOfGet) target.handlersOfGet = []
  target.handlersOfGet.push({
    route: route ?? '',
    method: propertyKey
  })
};
